package com.tulele.vtool.service.impl;

import com.tulele.vtool.mapper.UserVipLogInfoMapper;
import com.tulele.vtool.mapper.UserVipValidInfoMapper;
import com.tulele.vtool.mapper.VipPriceInfoMapper;
import com.tulele.vtool.model.UserVipLogInfo;
import com.tulele.vtool.model.UserVipValidInfo;
import com.tulele.vtool.model.VipPriceInfo;
import com.tulele.vtool.service.IVipInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VipInfoServiceImpl implements IVipInfoService {

    @Autowired
    private VipPriceInfoMapper vipPriceInfoMapper;

    @Autowired
    private UserVipValidInfoMapper userVipValidInfoMapper;

    @Autowired
    private UserVipLogInfoMapper userVipLogInfoMapper;

    @Override
    public List<VipPriceInfo> getVipPriceInfo(String springProfilesActive) {
        return vipPriceInfoMapper.queryVipPriceInfo(springProfilesActive);
    }

    @Override
    public UserVipValidInfo getVipValidInfo(Integer userId) {
        return userVipValidInfoMapper.queryVipValidInfo(userId);
    }

    @Override
    public VipPriceInfo getVipPriceInfoByVipId(Integer vipId) {
        return vipPriceInfoMapper.queryVipPriceInfoByVipId(vipId);
    }

    @Override
    public int recordUserVipLogInfo(UserVipLogInfo userVipLogInfo) {
        return userVipLogInfoMapper.addUserVipLogInfo(userVipLogInfo);
    }

    @Override
    public int modifyUserVipLogInfo(UserVipLogInfo userVipLogInfo) {
        return userVipLogInfoMapper.updateUserVipLogInfo(userVipLogInfo);
    }

    @Override
    public int recordUserVipValidInfo(UserVipValidInfo userVipValidInfo) {
        return userVipValidInfoMapper.addUserVipValidInfo(userVipValidInfo);
    }

    @Override
    public int modifyUserVipValidInfo(UserVipValidInfo userVipValidInfo) {
        return userVipValidInfoMapper.updateUserVipValidInfo(userVipValidInfo);
    }

    @Override
    public int delUserVipValid(Integer userId){
        return userVipValidInfoMapper.delUserVipValid(userId);
    }

}
